package com.jiang.blackjack.card;

/**
 * @ProjectName: BlackJack
 * @ClassName: Card
 * @Description: java类作用描述
 * @Author: 江
 * @CreateDate: 2020/3/1 13:34
 */
public abstract class Card {

    private int faceSeed;
    private int value;
    private int resIcon;

    //rank 0~12 ,random.nextInt(13)
    public Card(int faceSeed) {
        this.faceSeed = faceSeed;
        initValue();
        initIcon();
    }

    abstract void initIcon();

    void initValue() {
        switch (faceSeed + 1) {
            case 1:
                value = 11;
                break;
            case 2:
                value = 2;
                break;
            case 3:
                value = 3;
                break;
            case 4:
                value = 4;
                break;
            case 5:
                value = 5;
                break;
            case 6:
                value = 6;
                break;
            case 7:
                value = 7;
                break;
            case 8:
                value = 8;
                break;
            case 9:
                value = 9;
                break;
            case 10:
            case 11:
            case 12:
            case 13:
                value = 10;
                break;
            default:
                value = 0;
        }
    }

    public int getFaceSeed() {
        return faceSeed;
    }

    public void setFaceSeed(int faceSeed) {
        this.faceSeed = faceSeed;

    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public int getResIcon() {
        return resIcon;
    }

    public void setResIcon(int resIcon) {
        this.resIcon = resIcon;
    }
}
